package deng.hibernate.examples.mapping;

import javax.persistence.GenerationType;

@javax.persistence.Entity
@javax.persistence.Table(name="animals")
public class Animal {
	
	@javax.persistence.Id
	@javax.persistence.Column(name="id")
	//@javax.persistence.SequenceGenerator(name="SEQ_GEN.Animal", sequenceName="animals_seq")
	@javax.persistence.TableGenerator(name="SEQ_GEN.Animal", table="seq", valueColumnName="currentValue", pkColumnName="name", pkColumnValue="animals_seq")
	@javax.persistence.GeneratedValue(generator="SEQ_GEN.Animal", strategy=GenerationType.TABLE)
	private long id;
	
	@javax.persistence.Column(name="name")
	private String name;
	
	public long getId() {
		return id;
	}
	public void setId(long id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}	
	
	public String toString() {
		return "Animal[id=" + id + ", name=" + name + "]";
	}
}
